//
//  UISearchController2.swift
//  DemoUI
//
//  Created by 白瑾浩 on 2022/2/11.
//

import UIKit

class UISearchController2: UISearchController {

    override func viewDidLoad() {
        super.viewDidLoad()
        view.backgroundColor = .white
        self.searchBar.showsCancelButton = true
        //设置cannel为汉字“取消”
        let button = self.searchBar.subviews.first?.subviews.last?.subviews.last
        (button as! UIButton).setTitle("取消", for: .normal)
            
        
        
        
    }

}
